<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
			<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
			<script src="js/jquery-migrate-1.4.1.min.js" type="text/javascript" charset="utf-8"></script>
		<title>json版</title>
		<script type="text/javascript">
			function queryRes(){
//				$('#res').load('chaxun.html');
				$.ajax({
					type:"get",
					url:"score.json",
					async:true,
					success:function(data){
						var res_str = '';
						res_str = '<table border="" cellspacing="" cellpadding="">';
						res_str+='<tr><th>学号</th><th>姓名</th><th>分数</th></tr>';
//						$('#res').append('<table border="" cellspacing="" cellpadding="">');
//						$('#res').append('<tr><th>学号</th><th>姓名</th><th>分数</th></tr>');
						$.each(data, function(i,n) {
							res_str+='<tr><td>'+n.学号+'</td><td>'+n.姓名+'</td>'+'<td>'+n.学分+'</td></tr>';
//							$('#res').append('<tr><td>'+n.学号+'</td><td>'+n.姓名+'</td>'+'<td>'+n.学分+'</td></tr>');
						});
//						$('#res').append('</table>');
						res_str+='</table>';
						$('#res').html(res_str);
					}
				});
			}
		</script>
	</head>
	<body>
		<form method="post">
			<label for="search">学号</label><input type="text" name="search" id="search" value="" />
			<input type="button" value="查询" onclick="queryRes()"/>
			<div id="res">
				
			</div>
	</body>
</html>
